package com.ecar.common.dto;

import com.ecar.common.util.JSONSerialization;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * 接口返回
 * @author admin
 */
@XmlRootElement
public class DataBean implements JSONSerialization {

	/**
	 * 返回码
	 * 
	 * <pre>
	 * 响应状态
	 * 		200:成功
	 * 		400:参数错误
	 * 		403:禁止请求
	 * 		404:资源或对象未找到
	 * 		500:服务器端出现异常
	 * </pre>
	 **/
	private int code;

	private Object result;

	private String message;

    public DataBean() {
		this.code = 200;
		this.result = null;
	}

	public DataBean(String result) {
		this.code = 200;
		this.result = result;
	}

	public DataBean(int code, Object result) {
		this.code = code;
		this.result = result;
	}
	
	public DataBean(int code, Object result, String message) {
		super();
		this.code = code;
		this.result = result;
		this.message = message;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
